package com.wson.model.clouddisk.account.impl;

import com.wson.dao.entity.proton.IProtonEntityProp;
import com.wson.model.adapter.oauthaccount.impl.OAuthAccountModel;
import com.wson.model.basic.IMarkableField;
import com.wson.model.clouddisk.account.ICodiskAccountManip;
import com.wson.model.clouddisk.account.ICodiskAccountMeta;
import com.wson.model.clouddisk.account.ICodiskAccountView;
import com.wson.model.clouddisk.provider.ICodiskProviderMeta;

/**
 * @author chenhang
 *
 */
public class CodiskAccountModel extends OAuthAccountModel implements ICodiskAccountManip, ICodiskAccountView{

	@IMarkableField(Attribute=ATTR_PROVIDERID, Syntax=SYNC_PROVIDERID
			, PropID=PROP_CLD, PropIndex=IProtonEntityProp.PROP_VALUEINDEX_1
			, Behavior=REPLETENCY_SELECTVALUE
			, ValueType=IMarkableField.VALUETYPE_MODEL
			, ValueMeta=ICodiskProviderMeta.META_ID
			, ValueMatrix=IMarkableField.VALUEMMATRIX_ADMIN
	)
	private Long   providerID;

	@IMarkableField(Attribute=ATTR_AGENTID, Syntax=SYNC_AGENTID
			, PropID=PROP_CLD, PropIndex=IProtonEntityProp.PROP_VALUEINDEX_2
			, Behavior=REPLETENCY_SELECTVALUE
	)
	private Long   agentID;
	
	
	private Long 	spaceQuota;
	private Long 	spaceUsed;
	
	@Override
	public Long getProviderID() {
		return providerID;
	}
	@Override
	public void setProviderID(Long providerID) {
		this.providerID = providerID;
	}

	public Long getAgentID() {
		return agentID;
	}

	public void setAgentID(Long agentID) {
		this.agentID = agentID;
	}
	
	
	
	public Long getSpaceQuota() {
		return spaceQuota;
	}

	public void setSpaceQuota(Long spaceQuota) {
		this.spaceQuota = spaceQuota;
	}

	public Long getSpaceUsed() {
		return spaceUsed;
	}

	public void setSpaceUsed(Long spaceUsed) {
		this.spaceUsed = spaceUsed;
	}

	@Override
	public Long getMetaID(){
		return new Long(ICodiskAccountMeta.META_ID);
	}
	@Override
	public Long getCategoryID() {
		return new Long(ICodiskAccountMeta.META_ID);
	}

	@Override
	public String getSync() {
		return ICodiskAccountMeta.SYNC_SELF;
	}

	@Override
	public String toString() {
		return "ID: "+this.getID()
				+" PROVIDERID "+this.getProviderID()
				+" OAUTHTOKEN "+this.getOauthToken()
				+" OAUTHSECRET "+this.getOauthSecret()
				;
	}
	
	
	
}
